import request from '@/utils/request'

export function getJGLBList(data) {
  return request({
    url: '/jigoulb/query',
    method: 'post',
    data,
  })
}
export function getTree(data) {
  return request({
    url: '/jigou/getTree',
    method: 'post',
    data,
  })
}
export function getJigouByID(data) {
  return request({
    url: '/jigou/getJigouByID',
    method: 'post',
    data,
  })
}
export function getCDTree(data) {
  return request({
    url: '/caidan/getTree',
    method: 'post',
    data,
  })
}
export function doDelete(data) {
  return request({
    url: '/jigou/delete',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function save(data) {
  return request({
    url: '/jigou/save',
    method: 'post',
    data,
  })
}
export function add(data) {
  return request({
    url: '/jigou/add',
    method: 'post',
    data,
  })
}
export function update(data) {
  return request({
    url: '/jigou/update',
    method: 'post',
    data,
  })
}
export function saveJigouZiyuan(data) {
  return request({
    url: '/jigou/saveJigouZiyuan',
    method: 'post',
    data,
  })
}
export function getJiGouZYByID(data) {
  return request({
    url: '/ziyuan/treeByJigouId',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function juesequery(data) {
  return request({
    url: '/juese/query',
    method: 'post',
    data,
  })
}
export function yonghuquery(data) {
  return request({
    url: '/yonghu/queryPage',
    method: 'post',
    data,
  })
}
export function jueseziyuan(data) {
  return request({
    url: '/juese/queryJueseZiyuan',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function juesesave(ziyuanIds, data) {
  return request({
    url: `/juese/save?ziyuanIds=${ziyuanIds}`,
    method: 'post',
    data,
  })
}
export function doDeleteJuese(data) {
  return request({
    url: '/juese/delete',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function getJGyonghu(data) {
  return request({
    url: '/yonghu/queryCurrentJigouYonghu',
    method: 'post',
    data,
  })
}
export function getyonghuJS(data) {
  return request({
    url: `/yonghu/queryYonghuJuese?yonghuid=${data}`,
    method: 'post',
  })
}
export function yonghusave(jueseIds, data) {
  return request({
    url: `/yonghu/save?jueseIds=${jueseIds}`,
    method: 'post',
    data,
  })
}
export function doDeleteYonghu(data) {
  return request({
    url: '/yonghu/delete',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
//获取资源树
export function getZiyuanTree(data) {
  return request({
    url: '/ziyuan/tree',
    method: 'post',
    data,
  })
}
